﻿using lazada.Models;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Web;

namespace lazada.DAL
{
    public class ImageDAL:ConnectionDB
    {
        public ImageDAL(): base()
        {

        }

        public List<ImageModel> KMLAZADAimage()
        {
            List<ImageModel> list = new List<ImageModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from KMLAZADAimage";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while(dr.Read())
            {
                ImageModel img = new ImageModel();

                img.image = dr["ImagePath"].ToString();
                list.Add(img);
            }
            Connection.Close();
            return list;
        }

        public List<ImageModel> SKSDimage()
        {
            List<ImageModel> list = new List<ImageModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from SKSDimage";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while (dr.Read())
            {
                ImageModel img = new ImageModel();

                img.image = dr["ImagePath"].ToString();
                list.Add(img);
            }
            Connection.Close();
            return list;
        }
        public List<ImageModel> TRTXimage()
        {
            List<ImageModel> list = new List<ImageModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from TRTXimage";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while (dr.Read())
            {
                ImageModel img = new ImageModel();

                img.image = dr["ImagePath"].ToString();
                list.Add(img);
            }
            Connection.Close();
            return list;
        }
        public List<ImageModel> MBimage()
        {
            List<ImageModel> list = new List<ImageModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from MBimage";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while (dr.Read())
            {
                ImageModel img = new ImageModel();

                img.image = dr["ImagePath"].ToString();
                list.Add(img);
            }
            Connection.Close();
            return list;
        }
        public List<ImageModel> DHMKimage()
        {
            List<ImageModel> list = new List<ImageModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from DHMKimage";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while (dr.Read())
            {
                ImageModel img = new ImageModel();

                img.image = dr["ImagePath"].ToString();
                list.Add(img);
            }
            Connection.Close();
            return list;
        }
        public List<ImageModel> VOUCHERSimage()
        {
            List<ImageModel> list = new List<ImageModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from VOUCHERSimage";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while (dr.Read())
            {
                ImageModel img = new ImageModel();

                img.image = dr["ImagePath"].ToString();
                list.Add(img);
            }
            Connection.Close();
            return list;
        }
        public List<ImageModel> TTDNimage()
        {
            List<ImageModel> list = new List<ImageModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from TTDNimage";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while (dr.Read())
            {
                ImageModel img = new ImageModel();

                img.image = dr["ImagePath"].ToString();
                list.Add(img);
            }
            Connection.Close();
            return list;
        }
        public List<ImageModel> DOGDimage()
        {
            List<ImageModel> list = new List<ImageModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from DOGDimage";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while (dr.Read())
            {
                ImageModel img = new ImageModel();

                img.image = dr["ImagePath"].ToString();
                list.Add(img);
            }
            Connection.Close();
            return list;
        }
        public List<ImageModel> NCDSimage()
        {
            List<ImageModel> list = new List<ImageModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from NCDSimage";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while (dr.Read())
            {
                ImageModel img = new ImageModel();

                img.image = dr["ImagePath"].ToString();
                list.Add(img);
            }
            Connection.Close();
            return list;
        }
        public List<ImageModel> TABLETimage()
        {
            List<ImageModel> list = new List<ImageModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from TABLETimage";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while (dr.Read())
            {
                ImageModel img = new ImageModel();

                img.image = dr["ImagePath"].ToString();
                list.Add(img);
            }
            Connection.Close();
            return list;
        }
        public List<ImageModel> LAPTOPimage()
        {
            List<ImageModel> list = new List<ImageModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from LAPTOPimage";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while (dr.Read())
            {
                ImageModel img = new ImageModel();

                img.image = dr["ImagePath"].ToString();
                list.Add(img);
            }
            Connection.Close();
            return list;
        }
        public List<ImageModel> TVimage()
        {
            List<ImageModel> list = new List<ImageModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from TVimage";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while (dr.Read())
            {
                ImageModel img = new ImageModel();

                img.image = dr["ImagePath"].ToString();
                list.Add(img);
            }
            Connection.Close();
            return list;
        }
        public List<ImageModel> CAMERAimage()
        {
            List<ImageModel> list = new List<ImageModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from CAMERAimage";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while (dr.Read())
            {
                ImageModel img = new ImageModel();

                img.image = dr["ImagePath"].ToString();
                list.Add(img);
            }
            Connection.Close();
            return list;
        }
        public List<ImageModel> OTOimage()
        {
            List<ImageModel> list = new List<ImageModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from OTOimage";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while (dr.Read())
            {
                ImageModel img = new ImageModel();

                img.image = dr["ImagePath"].ToString();
                list.Add(img);
            }
            Connection.Close();
            return list;
        }
    }
}